clear*
set maxvar 11000

global date _2025_10_28
cd "/Users/atri0032/Dropbox/World Bank/Temperature, poverty, and inequality/Estimations/"

**********************************************************************************************************************
********************************** Table S12: The effects of temperature on poverty and inequality – 10-year analysis
**********************************************************************************************************************

// Headcount poverty & inequality
use "${date}/_data/spid_for_analysis_v2.dta", clear

local controls ln_GDPppp Unempilo agri manuf popgr 

estimates clear
qui reghdfe poor215 temp rainfall_sum humid `controls' if inrange(year,2008,2022), absorb(geo_code2_new year) cluster(geo_code2_new) keepsingle	
	est store m1
qui reghdfe poor215 temp rainfall_sum humid `controls' if inrange(year,2013,2022), absorb(geo_code2_new year) cluster(geo_code2_new) keepsingle	
	est store m2
qui reghdfe gini temp rainfall_sum humid  `controls' if inrange(year,2008,2022), absorb(geo_code2_new year) cluster(geo_code2_new) keepsingle	
	est store m3
qui reghdfe gini temp rainfall_sum humid `controls' if  inrange(year,2013,2022), absorb(geo_code2_new year) cluster(geo_code2_new) keepsingle	
	est store m4
	
local opts ///
	cells(b(star fmt(3)) se(par fmt(3))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N  r2, fmt(0 0 0 3) ///
	label("Observations" "R-squared")) ///
	eqlabels(none) mtitle("$2.15/day" "$2.15/day" "Gini" "Gini") ///
	collabels(,none) varlabels(temp "Temperature" rainfall_ave "Rainfall" humid "Humidity") varwidth(25) 
	
esttab m*, `opts'
esttab m* using "${date}/_tables/_tab_s11.csv", replace `opts'
